# 学习语义标签  lidarseg

from nuscenes.nuscenes import NuScenes
from nuscenes.utils import splits

# nuscenes 存放路径
nuscenes_data = "E:\\data\\3DpointCloud\\nuscenes\\nuscenes_mini"
nusc = NuScenes(version="v1.0-mini", dataroot=nuscenes_data, verbose=True)

nusc.list_lidarseg_categories(sort_by="count")

my_sample = nusc.sample[87]

# 样本的统计数据
nusc.get_sample_lidarseg_stats(my_sample["token"], sort_by="name")  # [name、index、count]

# 展示一个场景(scene)的 语义标签
my_scene = nusc.scene[0]
# nusc.render_scene_channel_lidarseg(my_scene["token"], 'CAM_BACK', filter_lidarseg_labels=[18, 28],
#                                    verbose=True, 
#                                    dpi=100,
#                                    imsize=(1280,720))

print(splits.mini_train)
for i in nusc.scene:
    print(i["name"])
